const redis = require('redis')
!(async function () {
    //创建客户端
    const redisClient = redis.createClient(6379, '127.0.0.1')

    //连接
    await redisClient.connect()
        .then(() => {
            console.log('redis is connect success');
        })
        .catch(console.error)
    //set 
    await redisClient.set('myname', 'lisi')
    const myneme = await redisClient.get('myname')
    console.log(myneme);

    //退出
    redisClient.quit()
})()